package com.westos.anno;

import java.lang.annotation.Annotation;

/**
 * 注解的演示
 */
public class AnnoClient {

    public static void main(String[] args){
        //使用反射获取类上面的注解
        Annotation[] annos = SpringUtil.class.getAnnotations();
        for(Annotation anno:annos){
            System.out.println(anno.toString());
            //读取注解的数据
            if(anno instanceof MyAnnotation){
                System.out.println(((MyAnnotation)anno).value());
            }
        }

    }
}